<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta 
        name="viewport" 
        content="width=device-width, initial-scale=1.0 user-scalable=no"> 
    
        <title>Document</title>
        <link rel="stylesheet" href="css/normalize.css">
        
        <script>
            (function (doc, win) {
                var docEl = doc.documentElement,
                    resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
                    recalc = function () {
                        var clientWidth = docEl.clientWidth;
                        if (!clientWidth) return;
                        docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
                    };
                if (!doc.addEventListener) return;
                win.addEventListener(resizeEvt, recalc, false);
                doc.addEventListener('DOMContentLoaded', recalc, false);
            })(document, window);
    
        </script>

        <style>
            .list {
                width:7.5rem;
                height:auto;
            }

            .list-item {
                width:7.5rem;
                height:2rem;
                background-color: pink;
                border-bottom:0.01rem solid #eee;
            }
        </style>
</head>
<body>
    <div class="list">
        <div class="list-item"></div>
        <div class="list-item"></div>
        <div class="list-item"></div>
        <div class="list-item"></div>
        <div class="list-item"></div>
        <div class="list-item"></div>
        <div class="list-item"></div>
        <div class="list-item"></div>
        <div class="list-item"></div>
        <div class="list-item"></div>
    </div>
    
    <script src="js/jquery-1.11.1.js"></script>
    <script src="js/vconsole.min.js"></script>
    <script>
        new VConsole();
    </script>
    <script>

        var flag = true;

        //拉数据的方法
        
        $(window).scroll(function () {     
            // console.log($(window).height(), '<--$(window).height() 窗口高度');
            // console.log($(document).scrollTop(), '<--$(document).scrollTop() 滚动高度');
            // console.log($(document).height(), '<--$(document).height() 文档高度');
            // console.log($(window).height() + $(document).scrollTop(), '计算后相加的');
            if ($(window).height() + $(document).scrollTop() + 50 >= $(document).height() && flag) {
                console.log($(window).height() + $(document).scrollTop());
                console.log('send ajax');
                flag = false;
            }
        })

    </script>
</body>
</html>
